package com.cskaoyan.mall.handler.typehandler;

import com.fasterxml.jackson.databind.ObjectMapper;
import org.apache.ibatis.type.JdbcType;
import org.apache.ibatis.type.MappedJdbcTypes;
import org.apache.ibatis.type.MappedTypes;
import org.apache.ibatis.type.TypeHandler;

import java.sql.CallableStatement;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

/**
 * WhereUse:
 * description:
 * date: 2021/1/11 16:09
 * Created By YiFangWan
 */
@MappedJdbcTypes(JdbcType.VARCHAR)
@MappedTypes(String[].class)
public class StringArrayTypeHandler implements TypeHandler<String[]> {

  ObjectMapper objectMapper = new ObjectMapper();

  @Override
  public void setParameter(PreparedStatement preparedStatement, int i, String[] strings, JdbcType jdbcType) throws SQLException {

  }

  @Override
  public String[] getResult(ResultSet resultSet, String s) throws SQLException {
    return new String[0];
  }

  @Override
  public String[] getResult(ResultSet resultSet, int i) throws SQLException {
    return new String[0];
  }

  @Override
  public String[] getResult(CallableStatement callableStatement, int i) throws SQLException {
    return new String[0];
  }
}


